<template>
<div :class="{'weui_loading_toast': type === 'loading'}">
  <div class="weui_mask_transparent"></div>
  <div class="weui_toast">
    <div class="weui_loading" v-if="type === 'loading'">
      <div v-for="(n,index) in num" class="weui_loading_leaf" :key="index" :class="'weui_loading_leaf_' + (n - 1)"></div>
    </div>
    <i class="weui_icon_toast" v-else></i>
    <div class="weui_toast_content"><slot></slot></div>
  </div>
</div>
</template>

<script>
export default {
  data() {
    return {
      num: 12
    }
  },
  props: {
    /**
     * toast类型
     * icon: 包含图标的提示框（默认）
     * loading: 包含loading动画的提示框
     */
    type: {
      type: String,
      required: false,
      default: 'icon'
    }
  }
}
</script>
<style>
@import '../../css/weui.min.css';
</style>
